package uw.illno.controller

import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Controller
import org.springframework.ui.Model
import uw.illno.service.AdministratorService
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestMethod
import uw.illno.pojo.Student

@Controller
class FindallStudent {
    @Autowired //按类型注入
    private lateinit var administratorService: AdministratorService

    @RequestMapping(value = ["/allstu"], method = [RequestMethod.POST])
    fun findall(model: Model): String {
        val list = administratorService.findAll()
        model.addAttribute("list", list)
        return "/adpages/stulist"
    }
}